<template>
  <div class="app-container">
    <el-tag
      style="margin: 10px 5px"
      v-for="tag in postNames"
      :key="tag"
    >{{ tag }}
    </el-tag>
  </div>
</template>

<script>
import { listPostNames } from '@/api/system/post'

export default {
  name: 'MyPostTag',
  props: {
    postIds: {
      required: true
    }
  },
  data() {
    return {
      postNames: []
    }
  },
  created() {
    this.getPostNames(this.postIds)
  },
  methods: {
    async getPostNames(postIds) {
      console.log('postIds ', postIds)
      const res = await listPostNames(postIds)
      console.log(res)
      this.postNames = res.data
    }
  }
}
</script>

<style scoped lang="scss">

</style>
